import { Card, Empty, Spin } from 'antd';
import React from 'react'
import { Map, Marker, NavigationControl, InfoWindow, ZoomControl } from 'react-bmapgl';
type Props = {
    lngLat: any,
    cityStay: any[],
    loading: any
}

export default function useMap(props: Props) {
    const { lngLat, cityStay,loading } = props;
    return (
        <div>
            {
                cityStay?.length > 0 ? cityStay?.map(item => {
                    return <Card key={item?.uid} style={{ margin: '8px 0' }}>
                        <div className='cityStay_item'>
                            <div>酒店名称</div>
                            <div>{item?.name}</div>
                        </div>
                        <div className='cityStay_item'>
                            <div>酒店地址</div>
                            <div>{item?.address}</div>
                        </div>
                        <div className='cityStay_item'>
                            <div>酒店电话</div>
                            <div>{item?.telephone}</div>
                        </div>
                    </Card>
                }) : <div style={{ position: 'absolute', top: '50%', left: 'calc(50% - 113px)' }}><Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description='暂无数据，请先选择节假日和地区' /></div>
            }
            {
                loading && <div className="example">
                    <Spin />
                </div>
            }
        </div>
    )
}